home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1984 Half 1 / rerun-1984-01-06-side-b.d64 / spriten feb p124 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  88 lines

  1. 20 rem draw the original borders by typing run
  2. 25 rem type goto 200 to save the picture and draw the sprite
  3. 30 rem type goto 500 to list the data on the screen
  4. 35 rem type goto 600 to redraw and modify the picture
  5. 40 rem type goto 700 to list data to the printer
  6. 45 dim ar(504),a1(63): v=53248
  7. 100 gosub1000
  8. 150 end
  9. 200 gosub 1200
  10. 300 gosub 1300
  11. 400 gosub 1400
  12. 450 end
  13. 500 gosub 1500
  14. 510 if p1=1 then print#1 : p1=0 : close 1
  15. 550 end
  16. 600 gosub 1600
  17. 650 end
  18. 700 p1=1
  19. 710 open 1,4 : cmd 1
  20. 720 goto 500
  21. 800 rem
  22. 1000 rem set up information for borders
  23. 1010 print"[147]":poke53281,11        
  24. 1020 s=1034 : s1=1057 : s2=1 : s3=100 : gosub 1100
  25. 1030 s=1073 : s1=1873 : s2=40 : s3=103 : gosub 1100
  26. 1040 s=1914 : s1=1937 : s2=1 : s3=99 : gosub1100
  27. 1050 s=1098 : s1=1937 : s2=40 : s3=101 : gosub1100
  28. 1060 s=1034 : poke s+7,122 : poke s+8,76
  29. 1065 poke s+15,122 : poke s+16,76
  30. 1070 s=1914 : poke s+7,80 : poke s+8,79
  31. 1075 poke s+15,80 : poke s+16,79
  32. 1080 s=1472 : poke s,67 : poke s+27,67
  33. 1090 return
  34. 1100 rem  draw borders
  35. 1110 for i=s to s1 step s2
  36. 1120 :    poke i,s3
  37. 1130 next i
  38. 1140 return
  39. 1150 rem
  40. 1200 rem  put bit data in array ar()
  41. 1210 i1=0 : rem  i1=zero
  42. 1220 for s=1074 to 1874 step 40
  43. 1230 :   for i=s to s+23
  44. 1240 :        i1=i1+1
  45. 1250 :        ar(i1)=0 : rem ar(i1)=zero
  46. 1260 :        if peek(i)=49 then ar(i1)=1
  47. 1270 :   next i
  48. 1280 next s
  49. 1290 return
  50. 1295 rem
  51. 1300 rem  decode & put decimal data in array a1()
  52. 1310 y=1
  53. 1320 for i=1 to 63
  54. 1330 :   dec=0 : bin=128 : rem  dec=zero
  55. 1340 :   for ix=y to y+7
  56. 1350 :       dec=dec+bin*ar(ix)
  57. 1360 :       bin=bin/2
  58. 1370 :   next ix
  59. 1380 :   y=y+8 : a1(i)=dec
  60. 1390 next i
  61. 1395 return
  62. 1397 rem
  63. 1400 rem  draw the sprite
  64. 1410 for i=1 to 63
  65. 1420 :   poke 831+i,a1(i)
  66. 1430 next i
  67. 1440 poke v+4,70 : poke v+5,205
  68. 1450 poke 2042,13 : poke v+21,4
  69. 1460 return
  70. 1470 rem
  71. 1500 rem  list data
  72. 1510 print"[147]" : poke v+21,0 : rem poke v+21,zero
  73. 1520 for i=1 to 63 step 3
  74. 1530 :   print a1(i),a1(i+1),a1(i+2)
  75. 1540 next i
  76. 1550 return
  77. 1560 rem
  78. 1600 rem  redraw picture
  79. 1610 poke53281,15:gosub 1000
  80. 1620 i1=0 : rem i1=zero
  81. 1630 for s=1074 to 1874 step 40
  82. 1640 :   for i=s to s+23
  83. 1650 :       i1=i1+1
  84. 1660 :       if ar(i1)=1 then poke i,49
  85. 1670 :   next i
  86. 1680 next s
  87. 1690 return
  88.